package com.langfeiyes.pattern.prototype;

import com.langfeiyes.pattern.principle.Singleton;

import java.text.MessageFormat;
import java.util.ArrayList;

public class App {
    public static void main(String[] args) throws CloneNotSupportedException {

        //克隆前
        Dept dept = new Dept("开发部");
        Emp emp = new Emp("dafei");
        emp.setDept(dept);
        System.out.println(emp);
        System.out.println("------------------------");

        //克隆后
        Emp clone  = (Emp) emp.clone();
        dept.setName("测试部");
        System.out.println(clone);
        System.out.println("------------------------");
        Singleton singleton = Singleton.getInstance();
        System.out.println(singleton);
        Singleton clonesi = (Singleton) singleton.clone();
        System.out.println(clonesi);
    }
}
